import 'package:base/main.dart';
import 'package:flutter/material.dart';
import 'package:framework/main.dart';

class IconWidget extends StatelessWidget {
  final GestureTapCallback? onTap;
  final String title;
  final String image;

  const IconWidget(
      {super.key, this.onTap, required this.title, required this.image});

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.only(
          left: Constants.spaceBase,
          right: Constants.spaceBase,
          top: Constants.px_10,
          bottom: Constants.px_10),
      child: InkWell(
        splashColor: Colors.transparent,
        highlightColor: Colors.transparent,
        onTap: onTap,
        child: Row(
          children: [
            ImageLoader.asset(
                path: image,
                width: Constants.iconSize,
                height: Constants.iconSize),
            SizedBox(width: Constants.px_10),
            Text(
              title,
              style: TextStyle(color: Colors.black, fontSize: 14),
            ),
            Expanded(child: SizedBox()),
            Icon(
              Icons.arrow_forward_ios,
              size: 16,
              color: Colors.grey,
            )
          ],
        ),
      ),
    );
  }
}
